package com.neuedu.hw20190214;

public class SalesEmployee extends ColaEmployee{
    // 成员变量
    private double monthSaleTotal;  // 月销售额
    private double saleRate;  // 提成率
    // 行为方法

    // 此处使用了多态：子类重写了父类的同名方法

    @Override
    public Double getSalary(int month) {
        //返回销售人员工资
        return monthSaleTotal*saleRate+super.getSalary(month);
    }

    //自定义构造方法

    public SalesEmployee(String empName, int empBirthdayMonth, double monthSaleTotal, double saleRate) {
        super(empName, empBirthdayMonth);
        this.monthSaleTotal = monthSaleTotal;
        this.saleRate = saleRate;
    }

    //默认构造方法

    public SalesEmployee() {
    }

    //setter和getter方法

    public double getMonthSaleTotal() {
        return monthSaleTotal;
    }

    public void setMonthSaleTotal(double monthSaleTotal) {
        this.monthSaleTotal = monthSaleTotal;
    }

    public double getSaleRate() {
        return saleRate;
    }

    public void setSaleRate(double saleRate) {
        this.saleRate = saleRate;
    }
}
